<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无障碍云后台管理系统</title>
<script type="text/javascript" src="/js/jquery-easyui-1.4.5/jquery.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="/js/jquery-easyui-1.4.5/jquery.easyui.min.js" charset="UTF-8"></script>
<script type="text/javascript" src="/js/jquery-easyui-1.4.5/locale/easyui-lang-zh_CN.js" charset="UTF-8"></script>
<link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4.5/themes/default/easyui.css" charset="UTF-8" />
<link rel="stylesheet" type="text/css" href="/js/jquery-easyui-1.4.5/themes/icon.css" charset="UTF-8" />
<script type="text/javascript" src="/js/jquery-1.11.1.min.js"></script>

<script type="text/javascript">
function exportReport() {
	var path = '${contextPath}/admin/exportReport';
	var checkNum = $("input[name='str']:checked").length;
	if (checkNum < 1) {
		alert("请至少选择一项!");
		return;
	}
	var form = document.getElementById("Form1");		
	form.action = path;
	form.submit();
}


function deleteReport() {
	var path = '${contextPath}/admin/deleteReport';
	var checkNum = $("input[name='str']:checked").length;
	if (checkNum < 1) {
		alert("请至少选择一项!");
		return;
	}
	if (confirm("确认删除吗?") == true) {
		var form = document.getElementById("Form1");
		form.action = path;
		form.submit();
		return;
	} else {
		return;
	}
}
</script>


</head>


<body>



	<form id="Form1" method="post" action="">
		<table id="tt" title="查询举报登记单" class="easyui-datagrid" toolbar="#toolbar">
			<thead>
				<tr>
					<th field="str" checkbox="true"></th>
					<th field="编号" width="190">编号</th>
					<th field="被举报方名称" width="300">被举报方名称</th>
					<th field="被举报方地址" width="300" align="left">被举报方地址</th>
					<th field="商品或服务内容" width="300" align="left">商品或服务内容</th>
					<th field="事发时间" width="120">事发时间</th>
					<th field="操作" width="120" align="left">操作</th>
				</tr>
			</thead>
				<c:forEach items="${result }" var="res">
					<tr>
						<td>${res.id }</td>
						<td>${res.id }</td>
						<td>${res.designation }</td>
						<td>${res.local }</td>
						<td>${res.goods_name }</td>
						<td>${res.year }-${res.month }-${res.day }</td>
						<td>
							<a href="${contextPath}/admin/queryReportById?id=${res.id }">查看</a> 
							<a href="${contextPath}/admin/exportReportById?id=${res.id }">导出</a> 
							<a href="${contextPath}/admin/deleteReportById?id=${res.id }" onclick="javascript:if (confirm('确定删除吗？')) { return true;}else{return false;};"> 删除</a>
						</td>
					</tr>
				</c:forEach>
		</table>
		<div id="toolbar">
			<a href="javascript:exportReport();" class="easyui-linkbutton" iconCls="icon-print" plain="true" >导出</a>
			<a href="javascript:deleteReport();" class="easyui-linkbutton" iconCls="icon-cancel" plain="true" >删除</a>
			<a href="${contextPath}/login" class="easyui-linkbutton" iconCls="icon-undo" plain="true" >退出</a>
		</div>
	</form>
</body>
</html>
